/**
 * 
 */
function saveMaterialFunc(chkId, proofingPatternId, proofingOrderId) {
	var chkData = ckEditorMap[chkId].getData();
	$.ajax({
		type : "POST",
		dataType : "json",
		url : "../proofingpattern/saveMaterial",
		data : {
			proofingPatternId : proofingPatternId,
			proofingOrderId : proofingOrderId,
			accessoryDetail:chkData
		},

		success : function(map) {
			if (map.head.respCode == "0000000") {
				alert("保存成功");
				window.location.href = "list";
			} else {
				alert(map.body);
			}
		},
		error : function(map) {
			alert("出现错误，请刷新页面");
		}

	});
}
function saveUploadSizefile(chkId, proofingPatternId, proofingOrderId) {
	var chkData = ckEditorMap[chkId].getData();
	$.ajax({
		type : "POST",
		dataType : "json",
		url : "../proofingpattern/saveSizeFile",
		data : {
			proofingPatternId : proofingPatternId,
			proofingOrderId : proofingOrderId,
			detailDescription:chkData
		},
		success : function(map) {
			if (map.head.respCode == "0000000") {
				alert("保存成功");
				window.location.href = "list";
			} else {
				alert(map.body);
			}
		},
		error : function(map) {
			alert("出现错误，请刷新页面");
		}

	});
}
function saveMakeStatus(proofingPatternId, proofingOrderId) {
	
	confirm("是否确定提交批版通过操作?",function(flag){
	
		if(flag){
			$.ajax({
				type : "POST",
				url : "../proofingpattern/saveMakeStatus",
				dataType : "json",
				data : {
					proofingPatternId : proofingPatternId,
					proofingOrderId : proofingOrderId
				},
				success : function(map) {
					if (map.head.respCode == "0000000") {
						success("保存成功",function(){
							window.location.href = "list";
						});
						
					} else {
						alert(map.body);
					}
				},
				error : function(map) {
					alert("出现错误，请刷新页面");
				}

			})
		}
		
	});
	
}
function saveBidPriceAdd(formId, proofingPatternId, proofingOrderId){
	$('#'+formId).data('bootstrapValidator').validate();
	if(!$('#'+formId).data('bootstrapValidator').isValid()) return false;
	$("#"+formId).ajaxSubmit({
        type: "POST",
        dataType: "json",
        url: "../proofingpattern/saveBidPrice",
        data:{proofingPatternId:proofingPatternId,proofingOrderId:proofingOrderId},
        success : function(map) {  
        	if(map.head.respCode=="0000000"){
            	alert("保存成功");
            	window.location.href="list";
            }else{
            	alert(map.body);
            }
        },  
        error : function(map) {  
            alert("出现错误，请刷新页面");  
        }  

    });
}
